import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/auth/token',
    method: 'post',
    data: data
  })
}

export function getInfo(token) {
  return request({
    url: '/user/userinfo',
    method: 'get',
    params: { token }
  })
}

export function getMenus(token) {
  return request({
    url: '/user/menus',
    method: 'get',
    params: { token }
  })
}

export function getAllMenus() {
  return request({
    url: '/user/menu/all',
    method: 'get'
  })
}

export function logout() {
  return request({
    url: '/user/logout',
    method: 'post'
  })
}
